// xjdklog
package main

import (
	"flag"
	"fmt"
	"io/ioutil"

	"github.com/bitly/go-simplejson"
)

/*
const (
	jdkout = []string{"str1", "str2", "str3", "str4"}
	stdout = []string{"str1", "str2", "str3", "str4"}
	stderr = []string{"str1", "str2", "str3", "str4"}
)
*/

var m1 = make(map[string]int64)

func ReadConfig(filepath string) *simplejson.Json {
	res, _ := ioutil.ReadFile(filepath)
	js, err := simplejson.NewJson(res)
	if err != nil {
		fmt.Println(err)
	}
	return js
}

func main() {
	cfile := flag.String("f", "", "config path")
	flag.Parse()

	if *cfile == "" {
		*cfile = "xjdklog.json"
	}
	js := ReadConfig(*cfile)
	/*
		jsmap, _ := js.Map()
		for _, b := range jsmap {
			newda, _ := b.(map[string]interface{})
			for c, d := range newda {
				fmt.Printf("%s:%s\n", c, d)
			}
		}
	*/
	/*
		jsmap, _ := js.Get("jdkout").Map()
		for c, d := range jsmap {
			fmt.Printf("%s:%s\n", c, d)
		}
	*/

}
